﻿using SelfManagement.Database.POCO;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SelfManagement.Web.Models.ViewModels.ArticleModels
{
    public class ArticleViewModel: BaseEditViewModel
    {
        /// <summary>
        /// 文章标题
        /// </summary>
        [Required]
        [StringLength(200)]
        [Display(Name = "文章标题")]
        public string Title { get; set; }

        /// <summary>
        /// 文章内容
        /// </summary>
        [Display(Name = "文章内容")]
        public string Content { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime UpdateTime { get; set; }

        [Required]
        [Display(Name = "文章分类")]
        public string Category_Id { get; set; }
        

        /// <summary>
        /// 文章分类
        /// </summary>
        public List<SelectListItem> SelectCategories { get; set; }

        /// <summary>
        /// 浏览访问权限 => 默认所有人可见
        /// </summary>
        public ArticlePermission ViewPermission { get; set; } = ArticlePermission.Public;

        /// <summary>
        /// 是否置顶
        /// </summary>
        [Display(Name = "是否置顶")]
        public bool IsTop { get; set; }

        /// <summary>
        /// 访问人数
        /// </summary>
        public int ViewCount { get; set; }
    }
}